package net.lingala.zip4j.model;


import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;


public class FileCompressPathZipParameters extends ZipParameters {
    private Map<String, String> filePaths;

    public FileCompressPathZipParameters(Map<String, String> filePaths) {
        super();
        this.filePaths = filePaths;
        if (this.filePaths == null) {
            this.filePaths = new HashMap<>();
        }
    }

    public String getFilePath(File file) {
        if(Objects.isNull(file)){
            throw new NullPointerException("file not null");
        }
        return filePaths.getOrDefault(file.getAbsolutePath(), null);
    }
    public String getFilePath(String filePath) {
        if(Objects.isNull(filePath)){
            throw new NullPointerException("filePath not null");
        }
        return filePaths.getOrDefault(filePath, null);
    }

}
